package www.dianbaozu.com.ui.manage

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.module.LoadMoreModule
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import www.dianbaozu.com.R
import www.wen.com.common.lib.data.entities.InvitationEntity
import www.wen.com.common.lib.extension.getColorAgency
import www.wen.com.common.lib.util.SpanUtils

class InvitationRecordAdapter :
    BaseQuickAdapter<InvitationEntity.Content, BaseViewHolder>(R.layout.item_invite_message),
    LoadMoreModule {

    override fun convert(holder: BaseViewHolder, item: InvitationEntity.Content) {
        holder.setText(R.id.tvInviteMessage, SpanUtils().also {
            it
                .append("${item.createTime} ")
                .setForegroundColor(getColorAgency(R.color.color999999))
                .append(" ${item.inviteUserName} ")
                .setForegroundColor(getColorAgency(R.color.colorFFFFFF))
                .append("成功邀请 ")
                .setForegroundColor(getColorAgency(R.color.color08D7B4))
                .append(item.userName)
                .setForegroundColor(getColorAgency(R.color.colorFFFFFF))
        }.create())
        holder.setText(R.id.tvIntoGroup, "进入 【${item.serverName}】")
    }
}